fix!: keep policy mock server out of the public API - #97
Merged
Conversation
Move the package broker mock into integration-test support and relocate cross-language fixtures outside the published crate. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Benoît Cortier (CBenoit)
enabled auto-merge (squash)
August 28, 2026 14:34
There was a problem hiding this comment.
Pull request overview
Internalizes the Rust package-broker mock and relocates shared protocol fixtures to repository-level test data.
Changes:
- Moves
MockPackageBrokerServerinto integration-test support. - Removes the mock from the crate’s public API and documentation.
- Relocates fixtures and updates Rust, .NET, and protocol references.
Reviewed changes
Copilot reviewed 8 out of 57 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
policies/test-data/package-broker/scenarios/extended.scenarios.json |
Adds extended policy scenarios. |
policies/test-data/package-broker/scenarios/baseline.scenarios.json |
Adds baseline policy scenarios. |
policies/test-data/package-broker/responses/winget-vscode-skiphash.denied.response.json |
Adds denied evaluation fixture. |
policies/test-data/package-broker/responses/winget-vscode-install.allowed.response.json |
Adds allowed evaluation fixture. |
policies/test-data/package-broker/responses/status-timeout.response.json |
Adds timeout status fixture. |
policies/test-data/package-broker/responses/status-starting.response.json |
Adds starting status fixture. |
policies/test-data/package-broker/responses/status-running.response.json |
Adds running status fixture. |
policies/test-data/package-broker/responses/status-failed.response.json |
Adds failed status fixture. |
policies/test-data/package-broker/responses/status-completed.response.json |
Adds completed status fixture. |
policies/test-data/package-broker/responses/status-canceled.response.json |
Adds canceled status fixture. |
policies/test-data/package-broker/responses/policy.response.json |
Adds active-policy fixture. |
policies/test-data/package-broker/responses/health-ready.response.json |
Adds ready-health fixture. |
policies/test-data/package-broker/responses/execution-winget-vscode-install.response.json |
Adds execution response fixture. |
policies/test-data/package-broker/responses/capabilities.response.json |
Adds broker capabilities fixture. |
policies/test-data/package-broker/responses/cancel-accepted.response.json |
Adds cancellation response fixture. |
policies/test-data/package-broker/requests/winget-vscode-x86.request.json |
Adds architecture-mismatch request. |
policies/test-data/package-broker/requests/winget-vscode-winget-fonts.request.json |
Adds source-mismatch request. |
policies/test-data/package-broker/requests/winget-vscode-version-out-of-range.request.json |
Adds out-of-range version request. |
policies/test-data/package-broker/requests/winget-vscode-version-in-range.request.json |
Adds allowed-version request. |
policies/test-data/package-broker/requests/winget-vscode-update-in-range.request.json |
Adds update request. |
policies/test-data/package-broker/requests/winget-vscode-skiphash.request.json |
Adds hash-bypass request. |
policies/test-data/package-broker/requests/winget-vscode-prerelease.request.json |
Adds prerelease request. |
policies/test-data/package-broker/requests/winget-vscode-prepost.request.json |
Adds pre-operation command request. |
policies/test-data/package-broker/requests/winget-vscode-msstore.request.json |
Adds alternate-source request. |
policies/test-data/package-broker/requests/winget-vscode-kill-before.request.json |
Adds process-termination request. |
policies/test-data/package-broker/requests/winget-vscode-interactive.request.json |
Adds interactive request. |
policies/test-data/package-broker/requests/winget-vscode-install.request.yaml |
Adds YAML installation request. |
policies/test-data/package-broker/requests/winget-vscode-install.request.json |
Adds JSON installation request. |
policies/test-data/package-broker/requests/winget-vscode-custom-param.request.json |
Adds custom-parameter request. |
policies/test-data/package-broker/requests/winget-unknown-install.request.json |
Adds unknown-package request. |
policies/test-data/package-broker/requests/winget-powertoys-install.request.json |
Adds PowerToys request. |
policies/test-data/package-broker/requests/winget-git-uninstall.request.json |
Adds Git uninstall request. |
policies/test-data/package-broker/requests/winget-git-custom-param-denied.request.json |
Adds denied custom parameter. |
policies/test-data/package-broker/requests/winget-git-custom-param-allowed.request.json |
Adds allowed custom parameter. |
policies/test-data/package-broker/requests/winget-git-custom-location-denied.request.json |
Adds denied install location. |
policies/test-data/package-broker/requests/winget-git-custom-location-allowed.request.json |
Adds allowed install location. |
policies/test-data/package-broker/requests/status-query-completed.request.json |
Adds status query fixture. |
policies/test-data/package-broker/requests/powershell-pester-version-out-of-range.request.json |
Adds rejected PowerShell version. |
policies/test-data/package-broker/requests/powershell-pester-version-allowed.request.json |
Adds allowed PowerShell version. |
policies/test-data/package-broker/requests/powershell-pester-update-currentuser.request.json |
Adds PowerShell update request. |
policies/test-data/package-broker/requests/powershell-pester-skipcheck.request.json |
Adds integrity-bypass request. |
policies/test-data/package-broker/requests/powershell-pester-prerelease.request.json |
Adds PowerShell prerelease request. |
policies/test-data/package-broker/requests/powershell-pester-poshtestgallery.request.json |
Adds untrusted-source request. |
policies/test-data/package-broker/requests/powershell-pester-currentuser.request.json |
Adds current-user request. |
policies/test-data/package-broker/requests/powershell-pester-allusers.request.json |
Adds machine-scope request. |
policies/test-data/package-broker/requests/missing-package-id.request.json |
Adds invalid request fixture. |
policies/test-data/package-broker/requests/chocolatey-git-install.request.json |
Adds Chocolatey request. |
policies/test-data/package-broker/requests/cancel-running.request.json |
Adds cancellation request. |
policies/test-data/package-broker/frames/event-channel.frames.bin |
Relocates binary event frames. |
policies/rust/now-policy-server-template/tests/support/mod.rs |
Registers private test support. |
policies/rust/now-policy-server-template/tests/support/mock.rs |
Internalizes the broker mock. |
policies/rust/now-policy-server-template/tests/sample_documents.rs |
Uses private mock and shared fixtures. |
policies/rust/now-policy-server-template/src/lib.rs |
Removes the public mock export. |
policies/rust/now-policy-server-template/README.md |
Removes public mock documentation. |
policies/rust/now-policy-server-template/Cargo.toml |
Updates crate metadata. |
policies/dotnet/Devolutions.Now.Policy.Client.Tests/TestData.cs |
Resolves repository-level fixtures. |
policies/docs/event-channel-protocol.md |
Updates the event-frame fixture path. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Richard Markiewicz (thenextman)
approved these changes
Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The package broker mock is an internal test double, so exposing it from the published server-template crate creates an unnecessary API commitment. Shared protocol fixtures also belong at repository scope rather than under one language's crate.
MockPackageBrokerServerinto private integration-test supportpolicies/test-data/package-brokerand update Rust, .NET, and protocol documentation references